define(["app", "angular", "services/BaseService"], function(app, angular) {
	
	var deps = ["$http", "BaseService"];
	
	function recordResource($http, BaseService) {
        return initResource($http, BaseService.restfulUrl + "record/", BaseService.formHeader);
    }
	
	var postHeader = {
	        "Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
	};
	
	function initResource($http, preUrl,formHeader) {
        return {
            deleteRecord:function(recordId){
                return $http.get(preUrl +recordId+ "/deleteRecord");
            },
            queryRecordList: function (pageNo,pageSize,timeStamp) {
                return $http.get(preUrl + "queryRecordList", {
                    params: {
                    	timeStamp: timeStamp,
                        pageSize: pageSize || 10,
                        pageNo: pageNo || 1
                    }
                });
            },
            queryCumulativeComsumeList: function (companyCode,tabChoose) {
            	
            	 return $http.get(preUrl + "queryCumulativeComsumeList", {
                     params: {
                    	 companyCode: companyCode,
                    	 tabChoose: tabChoose
                     }
                 });
            },
            queryCumulativeDetailList: function (companyCode,tabChoose,timeStamp,pageNo,pageSize,searchKey) {
                return $http.get(preUrl + "queryCumulativeDetailList", {
                    params: {
                    	companyCode: companyCode,
                    	tabChoose: tabChoose,
                    	timeStamp: timeStamp,
                    	pageNo:pageNo,
                    	pageSize :pageSize,
                    	searchKey :searchKey
                    }
                });
            },
            queryConfDetails: function (conferenceId,bookId,conferenceType) {
                return $http.get(preUrl + "queryConfDetails", {
                    params: {
                    	conferenceId: conferenceId,
                    	bookId: bookId,
                    	conferenceType: conferenceType
                    }
                });
            },
        };
        
    }
	recordResource.$inject = deps;
	app.lazy.factory("DataRecordResource", recordResource);
});
